const express = require('express')
//获取当前时间
const sd = require('silly-datetime');
var router = express.Router()
// 导入 fs模块
const fs = require('fs')

router.get('/recommend',(req,res)=>{
    let obj = {
        status: 0,
        msg: 'GET 请求成功',
        data: {
            "id": 1,
            "user_id": 1,
            'recommend': [
                {
                    id:1,
                    name:"熊大",
                    img:'http://127.0.0.1/img/image/activity.png',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:1,
                    name:"小二",
                    img:'http://127.0.0.1/img/image/img_q2.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:3,
                    name:'张三',
                    img:'http://127.0.0.1/img/image/img1.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:4,
                    name:'李四',
                    img:'http://127.0.0.1/img/image/img2.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:5,
                    name:'王五',
                    img:'http://127.0.0.1/img/image/img3.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:6,
                    name:'老六',
                    img:'http://127.0.0.1/img/image/img4.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                }
                
            ],
            'information': [
                {
                    id:1,
                    title:'构造人才培养输出闭环 拉勾荣获优秀企业服务品牌大奖1',
                    txt:'zcbuggnm',
                    img_portrait:'http://127.0.0.1/img/image/img_dk1.webp',
                    date_time: sd.format(new Date(), 'YYYY-MM-DD HH:mm')
                },
                {
                    id:2,
                    title:'构造人才培养输出闭环 拉勾荣获优秀企业服务品牌大奖2',
                    txt:'zcbuggnm',
                    img_portrait:'http://127.0.0.1/img/image/img_dk2.webp',
                    date_time: sd.format(new Date(), 'YYYY-MM-DD HH:mm')
                },
                {
                    id:3,
                    title:'构造人才培养输出闭环 拉勾荣获优秀企业服务品牌大奖3',
                    txt:'zcbuggnm',
                    img_portrait:'http://127.0.0.1/img/image/img_dk3.jpg',
                    date_time: sd.format(new Date(), 'YYYY-MM-DD HH:mm')
                },
                {
                    id:4,
                    title:'构造人才培养输出闭环 拉勾荣获优秀企业服务品牌大奖4',
                    txt:'zcbuggnm',
                    img_portrait:'http://127.0.0.1/img/image/img_k4.webp',
                    date_time: sd.format(new Date(), 'YYYY-MM-DD HH:mm')
                },
                {
                    id:5,
                    title:'构造人才培养输出闭环 拉勾荣获优秀企业服务品牌大奖4',
                    txt:'zcbuggnm',
                    img_portrait:'http://127.0.0.1/img/image/img_k4.webp',
                    date_time: sd.format(new Date(), 'YYYY-MM-DD HH:mm')
                },
                {
                    id:6,
                    title:'构造人才培养输出闭环 拉勾荣获优秀企业服务品牌大奖4',
                    txt:'zcbuggnm',
                    img_portrait:'http://127.0.0.1/img/image/img_k4.webp',
                    date_time: sd.format(new Date(), 'YYYY-MM-DD HH:mm')
                },

            ]
        }
    }
    res.send(JSON.stringify(obj))
})
router.get('/dynamic',(req,res)=>{
    let obj = {
        status: 0,
        msg: 'GET 请求成功',
        data: {
            "user_id": 1,
            'recommend': [
                {
                    id:1,
                    name:"熊大",
                    img:'http://127.0.0.1/img/image/img_dk2.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:1,
                    name:"小二",
                    img:'http://127.0.0.1/img/image/img_dk1.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:3,
                    name:'张三',
                    img:'http://127.0.0.1/img/image/img_dk3.jpg',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:4,
                    name:'李四',
                    img:'http://127.0.0.1/img/image/img_q2.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:5,
                    name:'王五',
                    img:'http://127.0.0.1/img/image/img_q1.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:6,
                    name:'老六',
                    img:'http://127.0.0.1/img/image/img_q3.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:7,
                    name:'小七',
                    img:'http://127.0.0.1/img/image/img5.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:8,
                    name:'老八',
                    img:'http://127.0.0.1/img/image/img_k2.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:9,
                    name:'小九',
                    img:'http://127.0.0.1/img/image/img_k3.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:10,
                    name:'老十',
                    img:'http://127.0.0.1/img/image/img_k4.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:11,
                    name:'千千',
                    img:'http://127.0.0.1/img/image/img_q1.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                {
                    id:12,
                    name:'十二',
                    img:'http://127.0.0.1/img/image/img_k2.webp',
                    img_portrait:'http://127.0.0.1/img/nopic.png'
                },
                
            ],
        }
    }
    res.send(JSON.stringify(obj))
})
router.get('/news',(req,res)=>{
    let obj = [
        {
            "id": 1,
            "title": "\u7f8e\u4e3d\u4e16\u754c",
            "content": "@![7.jpg](16)\n@![12.jpg](15)\n@![22.jpg](20)\n@![19.jpg](17)\n@![11.jpg](18)\n@![8.jpg](19)\n@![5.jpg](21)\n@![10.jpg](22)",
            "digg_count": 5,
            "comment_count": 15,
            "hits": 2411,
            "from": "\u7f8e\u4e3d\u98ce\u666f",
            "is_recommend": 0,
            "subject": "@![7.jpg](16)\n@![12.jpg](15)\n@![22.jpg](20)\n@![19.jpg](17)\n@![11.jpg](18)\n@![8.jpg](19)\n@![5.jpg](21)\n@![10.jpg](22)",
            "author": "\u8d3a\u9e4f\u7a0b",
            "audit_status": 0,
            "audit_count": 0,
            "user_id": 1,
            "contribute_amount": 0,
            "text_content": null,
            "created_at": "2020-11-26T08:01:47.000000Z",
            "updated_at": "2022-09-06T03:33:48.000000Z",
            "has_collect": false,
            "has_like": false,
            "is_pinned": false,
            "category": {
                "id": 1,
                "name": "\u9ed8\u8ba4\u5206\u7c7b",
                "rank": 0,
                "created_at": null,
                "updated_at": null
            },
            "image": {
                "id": 14,
                "size": "500x375",
                "paid_node": null
            },
            "tags": [{
                "id": 1,
                "name": "\u9ed8\u8ba4\u6807\u7b7e",
                "tag_category_id": 1,
                "weight": 0
            }]
        }
    ]
})

module.exports = router